package com.cxl.entity;


import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.net.URL;
import java.util.Date;

@Document(indexName = "index_course",type = "course")
public class Course implements Serializable {

  @Id
  private Integer cid;
  private String cname;
  private String pic;
  private Integer tid;
  @DateTimeFormat(pattern = "yyyy-MM-dd")
  private Date putdate;
  private Integer uid;
  private Integer number;
  private String video;
  private Integer state;
  private Integer check;

  //冗余字段
  private String tname; //分类名称
  private String uname; //用户名称

  private URL url;

  private String statename;
  private String checkname;

  //学生是否报名
  private Integer apply;


  @Override
  public String toString() {
    return "Course{" +
            "cid=" + cid +
            ", cname='" + cname + '\'' +
            ", pic='" + pic + '\'' +
            ", tid=" + tid +
            ", putdate=" + putdate +
            ", uid=" + uid +
            ", number=" + number +
            ", video='" + video + '\'' +
            ", state=" + state +
            ", check=" + check +
            ", tname='" + tname + '\'' +
            ", uname='" + uname + '\'' +
            ", url=" + url +
            ", statename='" + statename + '\'' +
            ", checkname='" + checkname + '\'' +
            ", apply=" + apply +
            '}';
  }

  public Course(Integer cid, String cname, String pic, Integer tid, Date putdate, Integer uid, Integer number, String video, Integer state, Integer check, String tname, String uname, URL url, String statename, String checkname, Integer apply) {
    this.cid = cid;
    this.cname = cname;
    this.pic = pic;
    this.tid = tid;
    this.putdate = putdate;
    this.uid = uid;
    this.number = number;
    this.video = video;
    this.state = state;
    this.check = check;
    this.tname = tname;
    this.uname = uname;
    this.url = url;
    this.statename = statename;
    this.checkname = checkname;
    this.apply = apply;
  }

  public Integer getApply() {
    return apply;
  }

  public void setApply(Integer apply) {
    this.apply = apply;
  }

  public Course(Integer cid, String cname, String pic, Integer tid, Date putdate, Integer uid, Integer number, String video, Integer state, Integer check, String tname, String uname, URL url, String statename, String checkname) {
    this.cid = cid;
    this.cname = cname;
    this.pic = pic;
    this.tid = tid;
    this.putdate = putdate;
    this.uid = uid;
    this.number = number;
    this.video = video;
    this.state = state;
    this.check = check;
    this.tname = tname;
    this.uname = uname;
    this.url = url;
    this.statename = statename;
    this.checkname = checkname;
  }

  public String getStatename() {
    return statename;
  }

  public void setStatename(String statename) {
    this.statename = statename;
  }

  public String getCheckname() {
    return checkname;
  }

  public void setCheckname(String checkname) {
    this.checkname = checkname;
  }

  public URL getUrl() {
    return url;
  }

  public void setUrl(URL url) {
    this.url = url;
  }

  public Course(Integer cid, String cname, String pic, Integer tid, Date putdate, Integer uid, Integer number, String video, Integer state, Integer check, String tname, String uname, URL url) {
    this.cid = cid;
    this.cname = cname;
    this.pic = pic;
    this.tid = tid;
    this.putdate = putdate;
    this.uid = uid;
    this.number = number;
    this.video = video;
    this.state = state;
    this.check = check;
    this.tname = tname;
    this.uname = uname;
    this.url = url;
  }

  public Integer getCid() {
    return cid;
  }

  public void setCid(Integer cid) {
    this.cid = cid;
  }

  public String getCname() {
    return cname;
  }

  public void setCname(String cname) {
    this.cname = cname;
  }

  public String getPic() {
    return pic;
  }

  public void setPic(String pic) {
    this.pic = pic;
  }

  public Integer getTid() {
    return tid;
  }

  public void setTid(Integer tid) {
    this.tid = tid;
  }

  public Date getPutdate() {
    return putdate;
  }

  public void setPutdate(Date putdate) {
    this.putdate = putdate;
  }

  public Integer getUid() {
    return uid;
  }

  public void setUid(Integer uid) {
    this.uid = uid;
  }

  public Integer getNumber() {
    return number;
  }

  public void setNumber(Integer number) {
    this.number = number;
  }

  public String getVideo() {
    return video;
  }

  public void setVideo(String video) {
    this.video = video;
  }

  public Integer getState() {
    return state;
  }

  public void setState(Integer state) {
    this.state = state;
  }

  public Integer getCheck() {
    return check;
  }

  public void setCheck(Integer check) {
    this.check = check;
  }

  public String getTname() {
    return tname;
  }

  public void setTname(String tname) {
    this.tname = tname;
  }

  public String getUname() {
    return uname;
  }

  public void setUname(String uname) {
    this.uname = uname;
  }

  public Course() {
  }

  public Course(Integer cid, String cname, String pic, Integer tid, Date putdate, Integer uid, Integer number, String video, Integer state, Integer check, String tname, String uname) {
    this.cid = cid;
    this.cname = cname;
    this.pic = pic;
    this.tid = tid;
    this.putdate = putdate;
    this.uid = uid;
    this.number = number;
    this.video = video;
    this.state = state;
    this.check = check;
    this.tname = tname;
    this.uname = uname;
  }
}
